#include "GameStateInit.h"

#include "Renderer.h"
#include "Binding.h"
#include <string>
#include "Camera.h"
#include "ShaderProgram.h"

#include <gtc/type_ptr.hpp>

lj::GameStateInit::GameStateInit()
: GameState(eGameState_Init)
{

}

lj::GameStateInit::~GameStateInit()
{

}

void lj::GameStateInit::Update()
{

}

void lj::GameStateInit::Init()
{
	le::Renderer* renderer = le::Binding::GetInstance()->GetRenderer();
	le::ShaderProgram* shaderProgram = renderer->CreateShader(le::Path("C:/Develop/LeJeux/LeProjects/LeJeux/Data/Shaders/Color.vs"), le::Path("C:/Develop/LeJeux/LeProjects/LeJeux/Data/Shaders/Color.ps"));

	le::Camera* activeCam = renderer->GetActiveCamera();
	shaderProgram->SetShaderVariable("viewMatrix", glm::value_ptr(activeCam->GetViewMatrix()));
	shaderProgram->SetShaderVariable("projectionMatrix", glm::value_ptr(activeCam->GetProjectionMatrix()));
	//shaderProgram->SetShaderVariable("worldMatrix", activeCam->GetProjectionMatrix().data);

	std::vector<le::Path> paths;
	le::Path::GetFilesInPath(le::Path("C:/Boost/1_55_0/stage/lib/"), "", true, paths);

	// renderer->MakeShaderActive(shaderId);

}
